Skip to content

Fix dotted canvas dashboard filenames#9626

Merged
nishantmonu51 merged 2 commits into
mainfrom
dashboard_name_fix
Jun 30, 2026
Merged

Fix dotted canvas dashboard filenames#9626
nishantmonu51 merged 2 commits into
mainfrom
dashboard_name_fix

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve dots in Rill resource names when deriving names from .yaml, .yml, and .sql file paths
  • Keep legacy compound-extension stripping for non-resource data files
  • Add regression coverage for dotted YAML/YML/SQL resource filenames

Test

  • npm run test -w web-common -- entity-mappers.spec.ts --run
  • npx prettier --check web-common/src/features/entity-management/entity-mappers.ts web-common/src/features/entity-management/entity-mappers.spec.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates entity-name inference for file paths so that Rill resource filenames with dots (e.g. dashboard.canvas.yaml) preserve the dotted portion when deriving the resource name, while keeping legacy behavior for non-resource data files with compound extensions.

Changes:

  • Update getNameFromFile to strip only the final resource extension for .yaml, .yml, and .sql files (preserving dots in the base name).
  • Retain legacy compound-extension stripping for non-resource data files.
  • Add regression tests covering dotted YAML/YML/SQL resource filenames.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web-common/src/features/entity-management/entity-mappers.ts Adjusts name derivation to preserve dotted resource basenames by stripping only the final resource extension.
web-common/src/features/entity-management/entity-mappers.spec.ts Adds regression tests validating dotted resource filename handling for YAML/YML/SQL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +70 to +76
// Rill resource names are inferred by removing only the final resource file
// extension, so dotted names like `dashboard.canvas.yaml` stay intact.
for (const extension of [".yaml", ".yml", ".sql"]) {
if (basename.endsWith(extension)) {
return basename.slice(0, -extension.length);
}
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in bbaa274. I centralized the resource extension list in file-path-utils and made extractFileExtension resource-aware, so dotted resource files return .yaml/.yml/.sql while non-resource data files keep the existing compound-extension behavior. Added regression coverage for dotted resource extension extraction and kind inference.

@nishantmonu51 nishantmonu51 merged commit f294551 into main Jun 30, 2026
13 checks passed
@nishantmonu51 nishantmonu51 deleted the dashboard_name_fix branch June 30, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants